package com.hand.liut.controller;

import com.hand.liut.service.PaymentHystrixService;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 刘涛
 * @Description: TODO
 * @DateTime: 2021/7/20 16:26
 **/
@RestController
public class PaymentHystrixController {

  @Autowired
  private PaymentHystrixService paymentHystrixService;

  @GetMapping(value = "/hystrix/run_ok/{id}")
  public String run_ok(@PathVariable("id") Integer id) {
    return paymentHystrixService.run_ok(id);
  }

  @GetMapping(value = "/hystrix/run_timeout/{id}")
  public String run_timeout(@PathVariable("id") Integer id) {
    return paymentHystrixService.run_timeout(id);
  }
}
